package dmmm.graph;

import java.awt.*;

import javax.swing.*;

public class DrawSquare extends JPanel {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private boolean vert,vertH,vertL,mid,up,down;// flag which line want draw
	
	//za magistrale address i data je bitno da se napise vrednost i zato se ovo postavlja tada
	private boolean printHexValue=false;
	private String hexValue;

	public DrawSquare() {
		setSize(50, 50);
		vert = false;
		vertL = false;
		vertH = false;
		up = false;
		mid = false;
		down = false;
	}

	public void paint(Graphics g) {
		super.paint(g);
		g.setColor(Color.black);
		if (vert)
			g.drawLine(0, 10, 0, 40);
		if (vertL)
			g.drawLine(0, 25, 0, 40);
		if (vertH)
			g.drawLine(0, 10, 0, 25);
		if (up)
			g.drawLine(0, 10, 50, 10);
		if (mid)
			g.drawLine(0, 25, 50, 25);
		if (down)
			g.drawLine(0, 40, 50, 40);
		if(printHexValue){
			g.drawString(hexValue, 10, 30);
		}
	}

	

	public boolean isVert() {
		return vert;
	}

	public void setVert(boolean vert) {
		this.vert = vert;
	}

	public boolean isUp() {
		return up;
	}

	public void setUp(boolean up) {
		this.up = up;
	}

	public boolean isDown() {
		return down;
	}

	public void setDown(boolean down) {
		this.down = down;
	}
	public boolean isVertH() {
		return vertH;
	}

	public void setVertH(boolean vertH) {
		this.vertH = vertH;
	}

	public boolean isVertL() {
		return vertL;
	}

	public void setVertL(boolean vertL) {
		this.vertL = vertL;
	}

	public boolean isMid() {
		return mid;
	}

	public void setMid(boolean mid) {
		this.mid = mid;
	}
	public void resetAllLines(){
		up=false;
		down=false;
		vert=false;
		mid=false;
		vertL=false;
		vertH=false;
		
		printHexValue=false;
	}
	public boolean isPrintHexValue() {
		return printHexValue;
	}

	public void setPrintHexValue(boolean printHexValue) {
		this.printHexValue = printHexValue;
	}

	public String getHexValue() {
		return hexValue;
	}

	public void setHexValue(String hexValue) {
		this.hexValue = hexValue;
	}
}
